﻿// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace DocumentFormat.OpenXml.Framework
{
    internal static class ReservedElementTypeIds
    {
        internal const int OpenXmlElementId = 9000;
        internal const int OpenXmlMiscNodeId = 9001;
        internal const int OpenXmlUnknownElementId = 9002;
        internal const int AlternateContentId = 9003;
        internal const int AlternateContentChoiceId = 9004;
        internal const int AlternateContentFallbackId = 9005;
        internal const int MaxReservedId = 10000;

        // ID of generated classes will start from 10001;

        /// <summary>
        /// Test whether the element is a strong typed element - the class is generated by CodeGen.
        /// </summary>
        /// <param name="element">The specified element.</param>
        /// <returns>True if the class of the element is generated.</returns>
        internal static bool IsStrongTypedElement(this OpenXmlElement element)
        {
            return element.ElementTypeId > MaxReservedId;
        }
    }
}
